public class GCDnd {
    public static void main(String[] args) {

        int a = 10086;
        int b = 95598;
        int c = a % b;

        while (a % b != 0) {
            a = b;
            b = c;
            c = a % b;
        }

        System.out.println(b);
    }
}
